From cbb6a62496af1a0653a69292f60f415bc86abe23 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Mon, 20 Mar 2017 11:44:42 +0000 Subject: [PATCH] meson: gdk: wayland: generate private wayland headers first gdkprivate-wayland.h includes generated wayland client protocol headers and is included from gdkdisplaymanager.c, so we need to generate those client protocol headers first also when building main gdk itself. --- gdk/meson.build | 8 +++++++- gdk/wayland/meson.build | 6 ++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/gdk/meson.build b/gdk/meson.build index 5b91e8a1df..fda09e843a 100644 --- a/gdk/meson.build +++ b/gdk/meson.build @@ -179,16 +179,22 @@ if wayland_enabled or broadway_enabled endif gdk_backends = [] +gdk_backends_gen_headers = [] # non-public generated headers foreach backend : ['broadway', 'wayland', 'x11', 'mir'] if get_variable('@0@_enabled'.format(backend)) subdir(backend) gdk_deps += get_variable('gdk_@0@_deps'.format(backend)) gdk_backends += get_variable('libgdk_@0@'.format(backend)) + # Special-case this for now to work around Meson bug with get_variable() + # fallback being an empty array, or any array (#1481) + if backend == 'wayland' + gdk_backends_gen_headers += get_variable('gdk_@0@_gen_headers'.format(backend)) + endif endif endforeach libgdk = static_library('gdk', - sources: [gdk_sources, gdkconfig], + sources: [gdk_sources, gdk_backends_gen_headers, gdkconfig], c_args: ['-DGDK_COMPILATION', '-DG_LOG_DOMAIN="Gdk"'], include_directories: [confinc, xinc, wlinc], link_with: gdk_backends, diff --git a/gdk/wayland/meson.build b/gdk/wayland/meson.build index d1a96b620c..b0d20ec473 100644 --- a/gdk/wayland/meson.build +++ b/gdk/wayland/meson.build @@ -64,12 +64,14 @@ proto_sources = [ join_paths(proto_dir, 'unstable/tablet/tablet-unstable-v2.xml')], ] +gdk_wayland_gen_headers = [] + # FIXME: there's some protostability/protoname stuff in Makefile.am I don't grok foreach p : proto_sources output_base = p[0] input = p[1] - gdk_wayland_sources += custom_target('@0@ client header'.format(output_base), + gdk_wayland_gen_headers += custom_target('@0@ client header'.format(output_base), input : input, output : '@0@-client-protocol.h'.format(output_base), command: [genprotocols, wayland_scanner, '@INPUT@', '@OUTPUT@', 'client-header']) @@ -81,7 +83,7 @@ foreach p : proto_sources endforeach libgdk_wayland = static_library('libgdk-wayland', - gdk_wayland_sources, gdkconfig, gdkenum_h, + gdk_wayland_sources, gdk_wayland_gen_headers, gdkconfig, gdkenum_h, include_directories: [confinc, gdkinc], c_args: ['-DGDK_COMPILATION', '-DG_LOG_DOMAIN="Gdk"'], dependencies: [gdk_deps, gdk_wayland_deps]) -- 2.30.2